{layout name="public/layout" /}
{include file='yxnavbar'}


<div class="main">
    <div class="panel panel-info">
        <div class="panel-heading">当前数量： {$total}</div>
        <div class="panel-body">
            <form id = "myform" action="./index.php" method="get" class="form-horizontal" role="form">
                <input type="hidden" name="c" value="site" />
                <input type="hidden" name="a" value="entry" />
                <input type="hidden" name="m" value="{$_P['m']}" />
                <input type="hidden" name="do" id="do" value="fans_other_info" />
                <input type="hidden" name="status" value="{$status}">
                <input type="hidden" name="pay_status" value="{$pay_status}">
                <input type="hidden" name="search_data" value="{$search_data}">
                <input type="hidden" name="fromuid" value="{$_P['fromuid']}">
                <div class="form-group">
                    <label class="col-xs-12 col-sm-3 col-md-1 control-label">状态</label>

                    {if $pay_status_arr && is_array($pay_status_arr)}
                    <div class="col-sm-9 col-lg-9 col-md-9 col-xs-9">
                        <div class="btn-group">
                            {loop $pay_status_arr $row}
                            <a href="{php echo filter_url('pay_status:'.$row['pay_status']);}" class="btn {if $pay_status == $row['pay_status']}btn-primary{else}btn-default{/if}">{php echo $row['title'];}<span style="color: #ff0000">{php echo $row['total'];}</span></a>
                            {/loop}
                        </div>
                    </div>
                    {/if}
                    {if count($themelist)>1 }
                    <div class="col-xs-12 col-sm-2 col-md-2">
                        <select onchange="submitForm();" class="form-control" name="themeid">
                            {loop $themelist $row}
                            <option value="{$row['id']}" {if $themeid == $row['id'] }selected="selected"{/if}>{$row['id']} - {php echo mb_substr($row['title'],0,8,'utf-8');}</option>
                            {/loop}
                        </select>
                    </div>
                    {else}
                    <input type="hidden" name="themeid" value="{$themeid}" />
                    {/if}
                </div>
                <div class="form-group">
                    <label class="col-xs-12 col-sm-3 col-md-1 control-label">{$is_special_mode}</label>
                    {if $type_arr}
                    <div class="col-sm-9 col-lg-9 col-md-9 col-xs-9">
                        <div class="btn-group">
                            {loop $type_arr $row}
                            <a href="{php echo filter_url('click_open_box:'.$row['click_open_box']);}" class="btn {if $click_open_box == $row['click_open_box']}btn-primary{else}btn-default{/if}">{php echo $row['title'];}<span style="color: #ff0000">{php echo $row['total'];}</span></a>
                            {/loop}
                        </div>
                    </div>
                    {/if}
                </div>
                <div class="form-group">
                    <label class="col-xs-12 col-sm-3 col-md-1 control-label">提交时间</label>
                    <div class="col-sm-3 col-lg-3 col-md-3 col-xs-3">
                        {php echo view_form_field_daterange('createtime', array('start'=>date('Y-m-d H:i:s',$starttime),'end'=>date('Y-m-d H:i:s',$endtime)), true);}
                    </div>
                </div>
                <div class="form-group clearfix">
                    <label class="col-xs-12 col-sm-3 col-md-1 control-label">关键字</label>
                    <div class="col-sm-3 col-xs-3 col-md-3">
                        <input class="form-control" name="search_data" placeholder="输入搜索内容" type="text" value="{$_P['search_data']}">
                    </div>
                    <div class="col-sm-3 col-lg-3 col-md-3 col-xs-6">
                        <button class="btn btn-primary"><i class="fa fa-search"></i> 搜索</button>
                        <input type="hidden" name="__token__" value="{$Request.token}"/>
                    </div>
                    <div class="col-sm-2 col-lg-2 col-md-2 col-xs-2">
                        {if (empty($_P['fromuid']))}
                        <input class="btn btn-default" type="submit" name="export_submit" onclick="jump()" id="export_submit" value="导出表单记录">
                        {else}
                        <div class="col-sm-2 col-lg-2 col-md-2 col-xs-2">
                            <input class="btn btn-info" type="submit" name="export_submit1" onclick="jump()" id="export_submit1" value="导出助力记录">
                        </div>
                        {/if}
                    </div>
                </div>
            </form>
        </div>
    </div>


    <div class="tab-content">
        <div class="panel panel-default">
            <div class="panel-body table-responsive">
                <table class="table table-hover">
                    <thead class="navbar-inner">
                    <tr>
                        <th style="width: 50px">UID</th>
                        <th style="width: 120px">昵称</th>
                        {loop $format_fileds_arr $row}
                        <th style="width:100px;max-width: 300px;word-wrap:break-word;color: #5c99f7" >{$row['name']}</th>
                        {/loop}
                        <th style="width: 100px">是否付款</th>
<!--                        //判断盲盒、点亮星星模式-->
                        {if $is_special_mode}
                        <th style="width: 120px">{$is_special_mode}</th>
                        {/if}
                        {if $show_help_flag}
                        <th style="width: 200px">{$show_help_flag_txt}</th>
                        {/if}
                        <th style="width: 120px">提交时间</th>
                        <th style="width: 120px">员工</th>
                        <th style="width: 120px;text-align: right">操作</th>
                    </tr>
                    </thead>
                    <tbody>
                    {loop $list $index $item}
                    <tr>
                        <td>{$item['uid']}</td>
                        <td>
                            <img src="{php echo tomedia($item['avatar']);}" width="28" style="border-radius: 3px;"><br>
                            {$item['nickname']}
                        </td>

                        {loop $format_fileds_arr $row}
                        <td style="color: #5c99f7">
                            {if $row['mode']==4}
                                <?php $temp_vals = explode("|",$item[$row['key']]);?>
                                {loop $temp_vals $rr}
                                    [{$rr}]<br>
                                {/loop}
                            {else}
                                {$item[$row['key']]}
                            {/if}
                        </td>
                        {/loop}
                        <td>
                            <span class="label label-{$item['pay_status']['class']}">{$item['pay_status']['txt']}</span>
                        </td>
                        {if $is_special_mode}
                        <td>
                            {if $item['click_open_box']}
                            <span class="label label-success">是</span>
                            {else}
                            <span class="label label-warning">否</span>
                            {/if}
                        </td>
                        {/if}
                        {if $show_help_flag}
                        <td>
<!--                            给谁助力-->
                            {if $item['friend_list']}
                                {loop $item['friend_list'] $val}
                                    {if !empty($val['username'])}
                            <a href="{php echo createWebUrl('fans_other_info', array('op' =>'display','themeid'=>$themeid,'fromuid'=>$val['uid']));}" >{$val['username']}-{$val['mobile']}</a>
                                    <br>
                                    {/if}
                                {/loop}
                            {/if}
                        </td>
                        {/if}

                        <td>
                            {php echo $item['created_at'];}
                        </td>
                        <td>
                            {$item['workername']}
                            <br>
                            {$item['teamname']}
                            <br>
                            {$item['companyname']}
                            <br>
                        </td>
                        <td style="text-align: right;">
                        <a href="{php echo createWebUrl($do, array('op' => 'delete','themeid'=>$themeid, 'id' => $item['id']));}"  class="btn btn-danger btn-sm" onclick="if(!confirm('表单信息删除，不可恢复，确定删除吗')) return false;"  title="删除" data-toggle="tooltip" data-placement="top"><i class="fa fa-times"></i></a>
                        </td>
                    </tr>
                    {/loop}
                    </tbody>
                </table>
            </div>
        </div>
    </div>
</div>
<script type="text/javascript">
    function jump(){
        layer.msg('正在准备下载');
    }
    function submitForm(){
        let tmp_do = 'record';
        $("#do").val(tmp_do);
        var form = document.getElementById("myform");
        form.submit();
    }
</script>
{$pager}
